package com.gy.bearhelps.home.util;

import android.content.Context;

import com.gy.bearhelps.R;
import com.gy.bearhelps.home.bean.CJSJBean;
import com.gy.bearhelps.home.bean.YMSJBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 高岳 on 2016/11/4.
 * Describe:
 */
public class CJSJDataManager {


    public static List<CJSJBean> getCJSJData(Context context){
        List<CJSJBean> list = new ArrayList<>();
        String[] titles = context.getResources().getStringArray(R.array.cjsj_title);
        String[] contents = context.getResources().getStringArray(R.array.cjsj_content);
        for (int i = 0; i < titles.length; i++) {
            CJSJBean bean = new CJSJBean();
            bean.id = i;
            bean.title = titles[i];
            bean.content = contents[i];
            list.add(bean);
        }
        return list;
    }

    public static List<CJSJBean> getDCBData(Context context){
        List<CJSJBean> list = new ArrayList<>();
        String[] titles = context.getResources().getStringArray(R.array.dcb_title);
        String[] contents = context.getResources().getStringArray(R.array.dcb_content);
        for (int i = 0; i < titles.length; i++) {
            CJSJBean bean = new CJSJBean();
            bean.id = i;
            bean.title = titles[i];
            bean.content = contents[i];
            list.add(bean);
        }
        return list;
    }


    public static List<YMSJBean> getYMSJData(Context context){
        List<YMSJBean> list = new ArrayList<>();
        String[] titles = context.getResources().getStringArray(R.array.ymsj_title);
        String[] names = context.getResources().getStringArray(R.array.ymsj_names);
        String[] contents = context.getResources().getStringArray(R.array.ymsj_content);
        String[] times = context.getResources().getStringArray(R.array.ymsj_times);
        for (int i = 0; i < titles.length; i++) {
            YMSJBean bean = new YMSJBean();
            bean.id = i;
            bean.title = titles[i];
            bean.content = contents[i];
            bean.times = times[i];
            bean.name = names[i];
            list.add(bean);
        }
        return list;
    }
}
